package day04.homework.expand;

public class FigureDemo {
    public static void main(String[] args) {
        /*
        利用for循环计算：打印字符*组成的直角三角形，输出结果如下所示：
        *
        ***
        *****
        *******
        *********
        ***********
     */
        for (int i = 1; i <= 6; i++) {
            for (int j = 1; j <= i*2-1 ; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println("-------------------------------------");

        for (int i = 6; i > 0; i--) {
            for (int j = (6-i)*2; j > 0 ; j--) {
                System.out.print(" ");
            }
            for (int j = 1; j <= i*2-1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println("-------------------------------------");

        for (int i = 1; i <= 6; i++) {
            for (int j = 1; j <= (6-i)*2; j++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= i*2-1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println("-------------------------------------");

        for (int i = 6; i >=0 ; i--) {
            for (int j = 1; j <= i*2-1; j++) {
                System.out.print("*");
            }
            System.out.println();
        }

    }
}
